<template>
  <div class="searchResult">
    <div class="nav">
      <div @click="selectType(0)" class="nav-item" :class="selectTypeNum == 0 ? 'active' : ''">全部</div>
      <div @click="selectType(1)" class="nav-item" :class="selectTypeNum == 1 ? 'active' : ''">事件记录</div>
      <div @click="selectType(2)" class="nav-item" :class="selectTypeNum == 2 ? 'active' : ''">问题跟踪</div>
      <div @click="selectType(3)" class="nav-item" :class="selectTypeNum == 3 ? 'active' : ''">维修记录</div>
      <div @click="selectType(4)" class="nav-item" :class="selectTypeNum == 4 ? 'active' : ''">经验反馈</div>
      <div @click="selectType(5)" class="nav-item" :class="selectTypeNum == 5 ? 'active' : ''">文件管理</div>
    </div>
    <div class="search-content">
      <div class="search-box">
        <Input type="text" style="width: 50%;margin-right:20px;float:left;" @on-enter="search" v-model="params.keyword"></Input>
        <div class="search-btn"  @click="search">检索</div>
      </div>
      <div class="fileList" v-for="(item, i) in fileList" :key="i">
        <Row v-if="item.moduleType == 1">
          <Col span="20">
            <div class="htitle">事件记录</div>
            <div class="desc">
              {{ item.aircrewNumber }}-{{ item.location }}：{{
              item.description
              }}
            </div>
           <div v-if="item.url&&item.url.length>0" class="desc">附件：
                 <span style="margin-right:10px;" v-for="(value,index) in item.url" :key="index">
                     <a :href="value" target="_blank">{{ value.substring(value.lastIndexOf('/')+1) }}</a>
                 </span>
            </div>
          </Col>
          <Col span="4">
            <Button type="primary" size="small" @click="look(item)">查看详情</Button>
            <!-- <Button
              type="success"
              v-if="item.url"
              style="margin-left:10px;"
              size="small"
              @click="down(item.url)"
            >点击下载</Button> -->
          </Col>
        </Row>
        <Row v-if="item.moduleType == 2">
          <Col span="20">
            <div class="htitle">问题跟踪</div>
            <div class="desc">{{ item.num }}-{{ item.location }}：{{ item.description }}</div>
            <div v-if="item.url&&item.url.length>0" class="desc">附件：
                 <span style="margin-right:10px;" v-for="(value,index) in item.url" :key="index">
                     <a :href="value" target="_blank">{{ value.substring(value.lastIndexOf('/')+1) }}</a>
                 </span>
            </div>
          </Col>
          <Col span="4">
            <Button type="primary" size="small" @click="look(item)">查看详情</Button>
            <!-- <Button
              type="success"
              v-if="item.url&&item.url.length>0"
              style="margin-left:10px;"
              size="small"
              @click="down(item.url)"
            >点击下载</Button> -->
          </Col>
        </Row>
        <Row v-if="item.moduleType == 3">
          <Col span="20">
            <div class="htitle">维修记录</div>
            <div class="desc">
              {{ item.aircrewNumber }}-{{ item.maintainCode }}：{{
              item.maintainContent
              }}
            </div>
            <div v-if="item.url&&item.url.length>0" class="desc">附件：
                 <span style="margin-right:10px;" v-for="(value,index) in item.url" :key="index">
                     <a :href="value" target="_blank">{{ value.substring(value.lastIndexOf('/')+1) }}</a>
                 </span>
            </div>
          </Col>
          <Col span="4">
            <Button type="primary" size="small" @click="look(item)">查看详情</Button>
            <!-- <Button
              type="success"
              v-if="item.url"
              style="margin-left:10px;"
              size="small"
              @click="down(item.url)"
            >点击下载</Button> -->
          </Col>
        </Row>
        <Row v-if="item.moduleType == 4">
          <Col span="20">
            <div class="htitle">经验反馈</div>
            <div class="desc">{{ item.aboutEquip }}-{{ item.subject }}：{{ item.eventDesc }}</div>
            <div v-if="item.url&&item.url.length>0" class="desc">附件：
                 <span style="margin-right:10px;" v-for="(value,index) in item.url" :key="index">
                     <a :href="value" target="_blank">{{ value.substring(value.lastIndexOf('/')+1) }}</a>
                 </span>
            </div>
          </Col>
          <Col span="4">
            <Button type="primary" size="small" @click="look(item)">查看详情</Button>
            <!-- <Button
              type="success"
              v-if="item.url"
              style="margin-left:10px;"
              size="small"
              @click="down(item.url)"
            >点击下载</Button> -->
          </Col>
        </Row>
        <Row v-if="item.moduleType == 5">
          <Col span="20">
            <div class="htitle">文件管理</div>
            <div class="desc">{{ item.title }}：{{ item.content }}</div>
            <div class="desc" v-if="item.url&&item.url!=''">附件：
               <span style="margin-right:10px;" v-for="(value,index) in item.url.split(',')" :key="index">
                     <a :href="value" target="_blank">{{ value.substring(value.lastIndexOf('/')+1) }}</a>
               </span>
            </div>

          </Col>
          <Col span="4">
            <Button type="primary" size="small" @click="look(item)">查看详情</Button>
            <!-- <Button
              type="success"
              v-if="item.url"
              style="margin-left:10px;"
              size="small"
              @click="down(item.url)"
            >点击下载</Button> -->
          </Col>
        </Row>
      </div>
    </div>
    <Page
    show-total
      :total="total"
      show-elevator
      :page-size="params.pageSize"
      @on-change="pageChange"
      style="margin:20px auto;text-align:center"
    />
    <Modal :mask-closable="false" :footer-hide="true" v-model="modal1" class-name="outdiv"	 title="事件记录" width="800">
      <div class="baseTitle" style="margin-top:0px;">基本信息</div>
      <Form :label-width="120">
        <Row :gutter="10">
          <Col span="12">
            <FormItem label="电站：">
              {{formItem.powerStation}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="HD编号：">
              {{formItem.hdNumber}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="机组编号：">
              {{formItem.aircrewNumber}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="型号：">{{ formItem.model }}</FormItem>
          </Col>
        </Row>
      </Form>
      <div class="baseTitle">事件信息</div>
      <Form :label-width="120">
        <Row :gutter="10">
          <Col span="24">
            <FormItem label="事件标题：">{{ formItem.title }}</FormItem>
          </Col>
          <Col span="12">
            <FormItem label="功能位置：">
             {{formItem.location}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="发生时间：">
              {{formItem.startTime}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="原因分析：">
              {{formItem.reasonAnalyze}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="原因分类：">
              {{formItem.reasonCatory}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="专业分类：">
              {{formItem.professionCatory}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="子系统：">
              {{formItem.subsystem}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="大修/日常：">
              {{formItem.everyday}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="问题进度：">
              {{formItem.issueProgress}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="影响WANO时间：">
              {{formItem.effectWano}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="IO1：">
              {{formItem.io1}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="IOER：">
              {{formItem.ioer}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="后果：">
              {{formItem.consequence}}
            </FormItem>
          </Col>
          <Col span="12">
            <FormItem label="问题分级：">
              {{formItem.ProblemListIndex}}
            </FormItem>
          </Col>
        </Row>
      </Form>
      <div class="baseTitle">事件描述</div>
      <Form :label-width="120">
        <FormItem label="事件描述：">
          {{formItem.description}}
        </FormItem>
        <FormItem label="风险分析：">
          {{formItem.ventureAnalysis}}
        </FormItem>
        <FormItem label="应对措施：">
         {{formItem.solutions}}
        </FormItem>
      </Form>
      <div class="baseTitle">填报信息</div>
      <Form :label-width="120">
        <Row :gutter="10">
          <Col span="12">
            {{formItem.recordName}}
          </Col>
          <Col span="12">
            <FormItem label="记录时间：">
              {{formItem.recordTime}}
            </FormItem>
          </Col>
        </Row>
      </Form>
    </Modal>

    <Modal :mask-closable="false" :footer-hide="true" v-model="modal2" class-name="outdiv" title="问题跟踪" width="1000">
      <div class="baseTitle" style="margin-top:0px;">基本信息</div>
      <Form :label-width="100">
        <Row :gutter="10">
            <Col span="8">
              <FormItem label="问题编号：">
                {{formItem.num}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="功能位置：">
                {{formItem.location}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="问题：">
                {{formItem.issue}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem :model="formItem" label="进展状态：">
                {{formItem.progressStatus}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="来源或跟踪项：">
                {{formItem.source}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="类别：">
                {{formItem.catory}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="计划完成时间：">
                {{formItem.planCompleteTime}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="问题类型：">
                {{formItem.issueCatory}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="重要度：">
                {{formItem.importance}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="负责人：">
                {{formItem.principalNames}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="跟踪人：">
                {{formItem.followerNames}}
              </FormItem>
            </Col>
            <Col span="8">
              <FormItem label="完成百分比：">
                {{formItem.completePercent}}
              </FormItem>
            </Col>
        </Row>
        <div class="baseTitle">问题描述</div>
        <Row :gutter="10">
            <Col span="24">
                <FormItem label="问题描述：">
                 {{formItem.description}}
                </FormItem>
            </Col>
        </Row>
        <div class="baseTitle">原因分析</div>
        <Row :gutter="10">
            <Col span="24">
                <FormItem label="原因分析：">
                {{formItem.reasonAnalyze}}
                  </FormItem>
            </Col>
        </Row>
        <div class="baseTitle">目标计划</div>
        <Table border :columns="columns2" :data="tableData2" style="margin-bottom:10px"></Table>
      </Form>
      <div class="baseTitle">问题跟踪</div>
      <Table border :columns="columns3" :data="tableData3"></Table>
    </Modal>

    <Modal :mask-closable="false" :footer-hide="true" v-model="modal3" class-name="outdiv" title="维修记录" width="1000">
      <div class="baseTitle" style="margin-top:0px;">基本信息</div>
           <Form :label-width="100">
             <Row :gutter="10">
                 <Col span="8">
                    <FormItem :model="formItem" label="电站：">
                      {{formItem.powerStation}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="HD编号：">
                      {{formItem.hdNumber}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="机组编号：">
                      {{formItem.aircrewNumber}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="型号：">
                      {{formItem.model}}
                    </FormItem>
                  </Col>
             </Row>
           </Form>
           <div class="baseTitle">维修信息</div>
           <Form :label-width="100">
             <Row :gutter="10">
                 <Col span="8">
                    <FormItem label="维修编号：">
                      {{formItem.maintainCode}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="维修类别：">
                    {{formItem.maintainType}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="计划开始时间：">
                      {{formItem.planStartTime}}
                    </FormItem>
                  </Col>
                   <Col span="8">
                    <FormItem label="计划结束时间：">
                       {{formItem.planEndTime}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="维修工期(天)：">
                      {{formItem.maintainDays}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="维修状态：">
                       {{formItem.maintainStatusDisplayName}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="维修经理：">
                     {{formItem.maintainManager}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="维修单号：">
                      {{formItem.code}}
                    </FormItem>
                  </Col>
             </Row>
           </Form>
           <div class="baseTitle">维修内容</div>
           <div>
                     {{formItem.maintainContent}}
                  </div>
           <Form :label-width="80">
             <Row :gutter="10">
                  <div class="baseTitle">异常记录</div>
                  <Col span="24" style="margin-bottom:10px;">
                    <Table border :columns="columns4" :data="tableData4"></Table>
                  </Col>
                  <div class="baseTitle">上传附件</div>

                   <Col span="24" style="margin-bottom:10px;">
                    <Table border :columns="columns5" :data="tableData5"></Table>
                  </Col>
                  <div class="baseTitle">填报信息</div>
                  <Col span="8">
                    <FormItem label="记录人：">
                       {{formItem.recordName}}
                    </FormItem>
                  </Col>
                  <Col span="8">
                    <FormItem label="记录时间：">
                    {{formItem.recordTime}}
                    </FormItem>
                  </Col>
             </Row>
           </Form>
    </Modal>

    <Modal :mask-closable="false" :footer-hide="true" v-model="modal4" class-name="outdiv" title="经验反馈" width="800">
       <div class="baseTitle" style="margin-top:0px;">外部事件分析</div>
           <Form :label-width="120">
             <Row :gutter="10">
                   <Col span="12">
                    <FormItem label="事件主题：">
                      {{formItem.subject}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="涉及设备：">
                      {{formItem.aboutEquip}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="事件来源：">
                      {{formItem.eventSource}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="事发时间：">
                      {{formItem.eventTime}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="关键字：">
                      {{formItem.eventKeyword}}
                    </FormItem>
                  </Col>
                   <Col span="12">
                    <FormItem label="事件后果：">
                      {{formItem.eventConsequence}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="事件描述：">
                      {{formItem.eventDesc}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="原因分析：">
                      {{formItem.reasonAnalysis}}
                    </FormItem>
                  </Col>
                  <Col span="24">
                    <FormItem label="纠正行动：">
                     {{formItem.correctAction}}
                    </FormItem>
                  </Col>
              </Row>
              </Form>
             <div class="baseTitle">内部反馈</div>
              <Form :label-width="180">
               <Row>
                 <Col span="24">
                   <FormItem label="是否需要修改公司程序或流程：">
                      {{formItem.innerFeedback}}
                    </FormItem>
                 </Col>
                 <Col span="24">
                   <FormItem label="其他反馈行动：">
                     {{formItem.outerFeedback}}
                    </FormItem>
                 </Col>
              </Row>
              </Form>
              <Form :label-width="120">
               <Row>
                <div class="baseTitle">后续行动</div>
                <div style="margin-bottom:10px;">
                    <Table border :columns="columns6" :data="tableData6"></Table>
                </div>
                 <div class="baseTitle">填报信息</div>
                 <Col span="12">
                   <FormItem label="记录人：">
                    {{formItem.recordName}}}
                   </FormItem>
                 </Col>
                 <Col span="12">
                   <FormItem label="记录时间：">
                    {{formItem.recordTime}}
                    </FormItem>
                 </Col>
             </Row>
           </Form>
    </Modal>

    <Modal :mask-closable="false" :footer-hide="true" v-model="modal5" class-name="outdiv" title="文件管理" width="800">
           <Form :model="formItem" :label-width="80">
             <Row :gutter="10" class="xzjz">
                  <Col span="24">
                    <FormItem label="标题：">
                      {{formItem.title}}
                    </FormItem>
                  </Col>
                  <Col span="24">
                    <FormItem label="简介：">
                     {{formItem.content}}
                    </FormItem>
                  </Col>
                  <Col span="24">
                    <FormItem label="文件链接：">
                      {{formItem.fileUrl}}
                    </FormItem>
                  </Col>
                   <Col span="12">
                    <FormItem label="文件分类：">
                     {{formItem.type}}
                    </FormItem>
                  </Col>
                 <Col span="12">
                    <FormItem :model="formItem" label="电站：">
                        {{formItem.powerStation}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="HD编号：">
                     {{formItem.hdNumber}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="机组编号：">
                        {{formItem.aircrewNumber}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="上传人：">
                       {{formItem.uploadUserName}}
                    </FormItem>
                  </Col>
                  <Col span="12">
                    <FormItem label="上传时间：">
                       {{formItem.uploadDate}}
                    </FormItem>
                  </Col>
                  <Col span="24" v-if="formItem.url">
                    <FormItem v-if="formItem.url!=''" label="附件：">
                      {{formItem.fileName}}
                      <Button style="margin-left:20px;" size="small" @click="down(formItem.url)" type="primary">下载文件</Button>
                    </FormItem>
                  </Col>
             </Row>
           </Form>
    </Modal>
  </div>
</template>

<script>
import axios from "axios";
import { SearchFile } from "@/api/search";
import {seachWenti,seachJiHua} from '@/api/problem'
import {findByMaintainRecordId,findByMaintainPlanId} from '@/api/repairRecord'
import {getHX} from '@/api/feedback'
export default {
  data() {
    return {
      total: 0,
      fileList: [],
      selectTypeNum: 0,
      modal1: false,
      modal2: false,
      modal3: false,
      modal4: false,
      modal5: false,
      formItem: {},
      params: {
        keyword: "",
        moduleType: 0,
        pageNo: 1,
        pageSize: 10
      },
      columns2: [
        {
          type: 'index',
          width: 60,
          title: '序号',
          align: 'center'
        },
        {
          title: '计划时间',
          key: 'planTime',
          width: 180
        },
        {
          title: '工作内容',
          key: 'workContent',
        },
        {
          title: '完成百分比',
          key: 'completePercent',
          width: 100
        },
        {
          title: '记录人',
          key: 'recordName',
          width: 80
        },
        {
          title: '记录时间',
          key: 'recordTime',
          width: 180
        }
      ],
      tableData2: [],
      columns3: [
        {
          type: 'index',
          width: 60,
          title: '序号',
          align: 'center'
        },
        {
          title: '进展',
          key: 'content'
        },
        {
          title: '记录人',
          key: 'recordName',
          width: 80
        },
        {
          title: '记录时间',
          key: 'recordTime',
          width: 180
        },
        {
          title: '操作',
          key: 'action',
          width: 160,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h(
                'Button',
                {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    marginRight: '5px'
                  },
                  on: {
                    click: () => {
                      this.down(params.row.attachUrl)
                    }
                  }
                },
                '下载附件'
              ),
            ])
          }
        }
      ],
      tableData3: [],
      columns4: [
        {
          type: 'index',
          title: "序号",
          width: 60,
          align: 'center'
        },
        {
          title: "功能位置",
          key: "location"
        },
        {
          title: "异常描述",
          key: "description"
        },
        {
          title: "处理结果",
          key: "result"
        },
        {
          title: "图片",
          key: "picUrl",
          align:"center",
          render: (h, params) => {
            return h('img' ,{
                          domProps: {
                            align: 'center',
                            src: params.row.picUrl,
                          },
                          style: {
                            width:'50px',
                            height: '50px',
                            margin:'10px'
                          },
                          on: {
                            click: () => {

                              },
                            }
                          })
          }
        },
        {
          title: "记录人",
          key: "recordName",
        },
        {
          title: "操作",
          key: "action",
          align: "center",
          render: (h, params) => {
            return h("div", [
              h(
                "Button",
                {
                  props: {
                    type: "primary",
                    size: "small"
                  },
                  style: {
                    marginLeft:'10px'
                  },
                  on: {
                    click: () => {
                      this.xiazai(params.row.picUrl);
                    }
                  }
                },
                "下载图片"
              )
            ]);
          }
        }
      ],
      tableData4: [],
      columns5: [
        {
          title: "标题",
          key: "title"
        },
        {
          title: "上传人",
          key: "uploadUserName"
        },
        {
          title: "附件地址",
          key: "url"
        },
        {
          title: "操作",
          key: "action",
          align: "center",
          render: (h, params) => {
            return h("div", [
              h(
                "Button",
                {
                  props: {
                    type: "primary",
                    size: "small"
                  },
                  style: {
                    marginLeft:'10px'
                  },
                  on: {
                    click: () => {
                      this.down(params.row.url);
                    }
                  }
                },
                "下载附件"
              )
            ]);
          }
        }
      ],
      tableData5:[],
      columns6:[
          {
          title: "改进行动",
          key: "action"
        },
        {
          title: "负责人",
          key: "principal"
        },
        {
          title: "完成期限",
          key: "completeDeadline"
        },
        {
          title: "完成状态",
          key: "status",
        },
        {
          title: "记录人",
          key: "recordName",
        },
        {
          title: "操作",
          key: "action",
          width:160,
          align: "center",
          render: (h, params) => {
            return h("div", [
              h(
                "Button",
                {
                  props: {
                    size: "small"
                  },
                  style: {
                    marginRight: '5px'
                  },
                  on: {
                    click: () => {
                      this.down(params.row.url)
                    }
                  }
                },
                "下载附件"
              )
            ]);

          }
        }
      ],
      tableData6: []
    };
  },
  created() {
    this.search();
  },
  methods: {
    search() {
      this.fileList = [];
      SearchFile(this.params)
        .then(res => {
          if (res.code == 0) {
            this.fileList = res.data.list;
            this.total=res.data.total
          } else {
            this.$Message.info(res.message);
          }
        })
        .catch(err => {
          console.error("err>" + JSON.stringify(err));
        });
    },
    pageChange(e) {
      this.params.pageNo = e;
      this.search();
    },
    selectType(e) {
      this.params.pageNo = 1;
      this.params.pageSize = 10;
      this.selectTypeNum = e;
      this.params.moduleType = e;
      this.search();
    },
    down(url) {
      window.open(url);
    },
    look(item) {
      this.formItem = item;
      if (item.moduleType == 1) {
        this.modal1 = true;
      } else if (item.moduleType == 2) {
        this.modal2 = true;
        seachWenti({defectFollowerId:item.id}).then(res=>{
            console.log(res.data,'获取问题跟踪列表');
            if (res.code == 0) {
                if(res.data){
                  this.tableData3 = res.data;
                }else{
                  this.tableData3 = [];
                }
              } else {
                this.$Message.info(res.message)
              }
          })
        seachJiHua({defectFollowerId:item.id}).then(res=>{
            console.log(res.data,'获取计划列表');
            if (res.code == 0) {
                if(res.data){
                  this.tableData2 = res.data;
                }else{
                  this.tableData2 = [];
                }
              } else {
                this.$Message.info(res.message)
              }
          })
      } else if (item.moduleType == 3) {
        findByMaintainPlanId({maintainPlanId:item.id}).then(res => {
        if (res.code == 0) {
          this.tableData4 = res.data
        }
      })
      findByMaintainRecordId({maintainRecordId:item.id}).then(res => {
        if (res.code == 0) {
          this.tableData5 = res.data
        }
      })
        this.modal3 = true;
      } else if (item.moduleType == 4) {
        getHX({knowledgeId:item.id}).then(res => {
        if (res.code == 0) {
          this.tableData6 = res.data
        }
        })
        this.modal4 = true;
      } else if (item.moduleType == 5) {
        this.formItem.fileName=this.formItem.url.substring(this.formItem.url.lastIndexOf('/')+1);
        this.modal5 = true;
      }
    }
  },
  mounted() {
    this.params.keyword = this.$route.query.name;
  }
};
</script>
<style lang="less">
.searchResult {
  background: #fff;
  height: 100%;
  padding: 15px;
  font-size: 14px;
  a:hover {
    text-decoration: underline;
  }
  .nav {
    font-size: 13px;
    width: 100%;
    padding: 10px 20px;
    display: flex;
    background: rgb(227, 241, 254);
    margin-bottom: 15px;
    .nav-item {
      margin-right: 15px;
      cursor: pointer;
      border: 1px solid #3778ee;
      padding: 5px 10px;
      border-radius: 5px;
    }
    .active {
      color: #ffffff;
      font-weight: 600;
      background: #3778ee;
    }
  }
  .search-content {
    width: 100%;
    .search-box {
      overflow: hidden;
      margin-bottom: 20px;
      input {
        outline: none;
        height: 30px;
        border: 1px solid #a5b7d6;
        border-radius: 5px;
        background: rgb(227, 241, 254);
        padding-left: 10px;
        font-size: 13px;
      }
      .search-btn {
         float:left;
        height: 30px;
        line-height: 30px;
        font-size: 13px;
        width:100px;
        background: #3778ee;
        color: #fff;
        padding: 0 30px;
        border-radius: 5px;
        cursor: pointer;
      }
    }
    .fileList {
      padding-bottom: 15px;
      margin-bottom: 15px;
      border-bottom: 1px solid #eaeaea;
      .htitle {
        font-size: 18px;
        font-weight: bold;
      }
      .desc {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #666;
      }
    }
  }
}
.outdiv .ivu-form-item {
  margin:0px;
}
.outdiv .baseTitle {
  font-weight: bold;
  font-size:14px;
  background:#f5f5f5;
  padding:5px 10px;
  margin-top: 5px;
  margin-bottom:5px;
}
</style>
